// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * IndexProcess generated by hbm2java
 */
@Entity
@Table(name = "index_process", catalog = "magento", uniqueConstraints = @UniqueConstraint(columnNames = "indexer_code"))
public class IndexProcess implements java.io.Serializable {

	private Integer processId;
	private String indexerCode;
	private String status;
	private Date startedAt;
	private Date endedAt;
	private String mode;
	private Set indexProcessEvents = new HashSet(0);

	public IndexProcess() {
	}

	public IndexProcess(String indexerCode, String status, String mode) {
		this.indexerCode = indexerCode;
		this.status = status;
		this.mode = mode;
	}

	public IndexProcess(String indexerCode, String status, Date startedAt,
			Date endedAt, String mode, Set indexProcessEvents) {
		this.indexerCode = indexerCode;
		this.status = status;
		this.startedAt = startedAt;
		this.endedAt = endedAt;
		this.mode = mode;
		this.indexProcessEvents = indexProcessEvents;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "process_id", unique = true, nullable = false)
	public Integer getProcessId() {
		return this.processId;
	}

	public void setProcessId(Integer processId) {
		this.processId = processId;
	}

	@Column(name = "indexer_code", unique = true, nullable = false, length = 32)
	public String getIndexerCode() {
		return this.indexerCode;
	}

	public void setIndexerCode(String indexerCode) {
		this.indexerCode = indexerCode;
	}

	@Column(name = "status", nullable = false, length = 15)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "started_at", length = 19)
	public Date getStartedAt() {
		return this.startedAt;
	}

	public void setStartedAt(Date startedAt) {
		this.startedAt = startedAt;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ended_at", length = 19)
	public Date getEndedAt() {
		return this.endedAt;
	}

	public void setEndedAt(Date endedAt) {
		this.endedAt = endedAt;
	}

	@Column(name = "mode", nullable = false, length = 9)
	public String getMode() {
		return this.mode;
	}

	public void setMode(String mode) {
		this.mode = mode;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "indexProcess")
	public Set getIndexProcessEvents() {
		return this.indexProcessEvents;
	}

	public void setIndexProcessEvents(Set indexProcessEvents) {
		this.indexProcessEvents = indexProcessEvents;
	}

}
